import requests
import selenium
from selenium.webdriver.common.action_chains import ActionChains
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
import re

driver = webdriver.Chrome()

driver.get("website")



ele_acc = driver.find_element(By.XPATH,"loactor").send_keys('account')
ele_pwd = driver.find_element(By.XPATH,"loactor").send_keys('pwd')
ele_sub = driver.find_element(By.XPATH,"loactor").click()

# if we select in the element page
ActionChains(driver).move_to_element().perform()
select = Select.select_by_index(0)

js = "Document.getDocumentByID("").click()"
driver.execute_script(js)


".//contain[@id,'text_included']"



assert driver.current_url('new one ')


common exception
waiting
3 kinds of
time.sleep()
WebDriverWait(driver, 20, 0.5).until(EC.presence_of_element_located())
impilictly,wait(20)

driver.switch_to.

driver.close()  close the current window

driver.quit()  quit the browser



select dept,count(emp) from (select * from dept_table as a right join emp_table as b on a.deptid = b.deptid) having count(emp)>=1;)

emp info table
we can all the emloyees and their dept
we

subquery and inner

outer join
left join

right join base the right table, and combine the left table data which fit on the condition like left.A = right.A

def get(url,header):
    url = 'www...xxxx'
    header = {'cookie':'',
              'orign_reference':'',
              }
    res = requests.get(url,header=header)
    res.json()
    res.text()
    code = res.status_code
    assert code == '200'

negative = ['500','400','300','404']

def get(url,header,negative):
    url = 'www...xxxx'
    header = {'cookie':'',
              'orign_reference':'',
              }
    try:
        res = requests.get(url,header=header)
        res.json()
        res.text()
        code = res.status_code
    except Exception as E:
        print('negative case complete',E)
    finally:
        print("case complete")

